package cn.wangxl.loglog.constants;

/**
 * @Deacription 日志类型枚举
 * @Author 20112128
 * @Date 2020/5/1 1:39
 **/
public enum LogTypeEnum {

    SERVICE("service","service"),

    SYSTEM("system","system"),

    EXCEPTION("exception","exception"),

    GC("gc","gc"),

    REQUEST("request","request"),

    ;
    private String type;

    private String topic;

    LogTypeEnum(String type, String topic) {
        this.type = type;
        this.topic = topic;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public static LogTypeEnum getByType(String type){
        for(LogTypeEnum logTypeEnum:LogTypeEnum.values()){
            if(logTypeEnum.type.equals(type)){
                return logTypeEnum;
            }
        }
        return null;
    }
}
